package com.hshx.client;

import com.hshx.VO.UsersVo;
import com.hshx.pojo.Users;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "gateway",
                path = "/systemService",
                contextId = "UsersClient")
public interface UsersClient {
    @GetMapping("/getUsersOne")
    Users getUsers(@RequestParam(name = "username") String username,@RequestParam(name = "password") String password);

    @GetMapping("/getUsersList")
    List<Users> getUsersList();

    @PostMapping("/addUsers")
    boolean addUsers(@SpringQueryMap Users users);

    @PostMapping("/updateUsers")
    boolean updateUsers(@SpringQueryMap Users users);

    @RequestMapping("/removeUsers")
    boolean removeUsers(@RequestParam(name = "users_id") int users_id);

//    @RequestMapping("/getAllUsersVo")
//    List<UsersVo> getAllUsersVo();
//
//    @RequestMapping("/getUsersVo")
//    UsersVo getUsersVo(@RequestParam(name = "users_id") int users_id);

    @RequestMapping("/testSession")
    String testSession();

    @RequestMapping("/getUsersById")
    public Users getUsersById(@RequestParam(name = "users_id") Integer users_id);

    @RequestMapping("/getUserByUsername")
    public Users getUserByUsername(@RequestParam(name = "username") String username);

    @RequestMapping("/hasSalary")
    public boolean hasSalary(@RequestParam(name = "users_salary") Integer users_salary);

    @RequestMapping("/getManNumber")
    long getManNumber();

    @RequestMapping("/getWomanNumber")
    long getWomanNumber();
}
